goog.provide('example');

goog.require('goog.json');
goog.require('goog.style');
goog.require('goog.dom');

var d = {
	name: 'alidiep',
	age: 22,
	toJSON: function() { return 'haha'; },
};
//var a = goog.json.serialize(d);
var a = JSON.stringify(d);
//alert(a);

$('form').submit(function() {
	var a = $(this).serialize();
	alert(a);
	return false;
});

function showValues() {
    var str = $("form").serialize();
    $("#results").text(str);
	var newHeader = goog.dom.createDom('h1', {'style': 'background-color:#EEE'}, 'Hello world!');
	goog.dom.appendChild(document.body, newHeader);
	//goog.style.scrollIntoContainerView($("#results"),$("#container"));
}
    $(":checkbox, :radio").click(showValues);
    $("select").change(showValues);
    showValues();